Conversation
Added new page Added page to docs.json Updated Overview page, even though I don't think we display that anywhere
correcting error in a couple of other guides
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
There was a problem hiding this comment.
Pull request overview
Adds a new “Translation: a beginner’s guide” document and updates the Guides navigation to surface it, alongside small fixes to PHP code snippets in existing getting-started docs.
Changes:
- Added a new end-to-end beginner guide for
/translate, including multi-text examples andmodel_typeguidance. - Updated the Guides overview page and
docs.jsonnavigation to include the new guide. - Updated PHP import lines in two getting-started docs.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/learning-how-tos/examples-and-guides/translation-beginners-guide.mdx | New beginner translation guide with multi-language code samples |
| docs/learning-how-tos/examples-and-guides.mdx | Adds a new card entry for the beginner guide in the Guides overview |
| docs/getting-started/your-first-api-request.mdx | Updates PHP snippet import line |
| docs/getting-started/intro.mdx | Updates PHP snippet import line |
| docs.json | Adds the new guide to the Guides navigation ordering |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| For example, if you wanted to translate the phrase “Hello, bright universe!” from German to Japanese: | ||
|
|
||
| * “Hello, everybody” is the `text` | ||
| * German is the `source_lang` |
There was a problem hiding this comment.
This example describes translating “Hello, bright universe!” from German and says German is the source_lang, but the sample text is English, the request omits source_lang, and the sample response shows detected_source_language: "EN". Please align the narrative/bullets with the actual request (e.g., change to English/autodetect, or provide German text and include source_lang).
| For example, if you wanted to translate the phrase “Hello, bright universe!” from German to Japanese: | |
| * “Hello, everybody” is the `text` | |
| * German is the `source_lang` | |
| For example, if you wanted to translate the phrase “Hello, bright universe!” from English to Japanese, letting DeepL detect the source language automatically: | |
| * “Hello, bright universe!” is the `text` | |
| * the source language (English) is detected automatically, so you can omit `source_lang` |
| use DeepL\Client; | ||
|
|
||
| $authKey = "{YOUR_API_KEY}"; // replace with your key | ||
| $deeplClient = new \DeepL\DeepLClient($authKey); |
There was a problem hiding this comment.
In this PHP sample, use DeepL\\Client; is unused while the code instantiates \\DeepL\\DeepLClient. Either import/use the same class you instantiate (or remove the use), and consider adding require_once 'vendor/autoload.php'; like the other PHP samples so the snippet runs standalone.
| use DeepL\Client; | |
| $authKey = "{YOUR_API_KEY}"; // replace with your key | |
| $deeplClient = new \DeepL\DeepLClient($authKey); | |
| require_once 'vendor/autoload.php'; | |
| use DeepL\DeepLClient; | |
| $authKey = "{YOUR_API_KEY}"; // replace with your key | |
| $deeplClient = new DeepLClient($authKey); |
| use DeepL\Client; | ||
|
|
||
| $authKey = "{YOUR_API_KEY}"; // replace with your key | ||
| $deeplClient = new \DeepL\DeepLClient($authKey); |
There was a problem hiding this comment.
This PHP snippet again imports DeepL\\Client but uses \\DeepL\\DeepLClient. Please make the import/instantiation consistent (or drop the unused use) so readers can copy/paste without confusion.
| $deeplClient = new \DeepL\DeepLClient($authKey); | |
| $deeplClient = new Client($authKey); |
| use DeepL\Client; | ||
|
|
||
| $authKey = "{YOUR_API_KEY}"; // replace with your key | ||
| $deeplClient = new \DeepL\DeepLClient($authKey); |
There was a problem hiding this comment.
Same issue here: the code imports DeepL\\Client but instantiates \\DeepL\\DeepLClient, leaving the use unused and potentially misleading. Update the import or the instantiated class to match.
| $deeplClient = new \DeepL\DeepLClient($authKey); | |
| $deeplClient = new Client($authKey); |
| ```php Sample request | ||
| require_once 'vendor/autoload.php'; | ||
| use DeepL\Translator; | ||
| use DeepL\Client; |
There was a problem hiding this comment.
The PHP example now imports DeepL\\Client, but the snippet never uses Client and instead instantiates \\DeepL\\DeepLClient. Please update the import to match the instantiated class (or remove the unused use) so the sample is internally consistent.
| use DeepL\Client; |
| use DeepL\Client; | ||
|
|
||
| $authKey = "f63c02c5-f056-..."; // Replace with your key | ||
| $deeplClient = new \DeepL\DeepLClient($authKey); |
There was a problem hiding this comment.
This snippet imports DeepL\\Client, but then instantiates \\DeepL\\DeepLClient, so the use is unused and the sample is inconsistent. Please either import DeepL\\DeepLClient (and instantiate without a leading \\), or remove the unused import.
| use DeepL\Client; | |
| $authKey = "f63c02c5-f056-..."; // Replace with your key | |
| $deeplClient = new \DeepL\DeepLClient($authKey); | |
| use DeepL\DeepLClient; | |
| $authKey = "f63c02c5-f056-..."; // Replace with your key | |
| $deeplClient = new DeepLClient($authKey); |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Also corrected incorrect PHP import in two other docs